package com.ruoyi.base.domain;

import java.util.Date;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.domain.entity.SysUser;

/**
 * 专业对象 base_specialty
 * 
 * @author yepanpan
 * @date 2020-11-09
 */
@ApiModel("专业实体")
@Getter
@Setter
public class BaseSpecialty extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 自增长主键 */
    private Long id;

    /** 开设部门 */
    @ApiModelProperty("开设部门ID")
    private Long deptId;

    @Excel(name = "开设部门")
    @ApiModelProperty("开设部门")
    private String deptName;

    /** 专业代码 */
    @Excel(name = "专业代码")
    @ApiModelProperty("专业代码")
    @NotBlank(message="专业代码不能为空")
    private String code;

    /** 专业名称 */
    @Excel(name = "专业名称")
    @ApiModelProperty("专业名称")
    @NotBlank(message="专业名称不能为空")
    private String title;
    
    /** 学制 */
    @Excel(name = "学制")
    @ApiModelProperty("学制")
    @NotBlank(message="专业学制不能为空")
    @Min(value = 1, message = "学制不合法")
    @Max(value = 12, message = "学制不合法")
    private Integer period;


	/** 开设日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "开设日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty("开设日期")
    @NotNull(message="开设日期不能为空")
    private Date startDate;

    /** 禁用日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "禁用日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty("禁用日期")
    private Date endDate;

    /** 专业负责人 */
    @ApiModelProperty("专业负责人ID")
    private Long masterUser;

    @Excel(name = "专业负责人")
    @ApiModelProperty("专业负责人")
    private SysUser user;
    
	/** 排序 */
    @Excel(name = "排序")
    @ApiModelProperty("排序")
    private Long listSort;

    /** 是否招生 */
    @Excel(name = "是否招生", dictType = "sys_yes_no")
    @ApiModelProperty("是否招生")
    private String isEnroll;

    /** 状态 */
    @Excel(name = "状态", dictType = "common_status")
    @ApiModelProperty("状态")
    @NotBlank(message="状态不能为空")
    private String status;


	@Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("deptId", getDeptId())
            .append("deptName", getDeptName())
            .append("period", getPeriod())
            .append("code", getCode())
            .append("title", getTitle())
            .append("startDate", getStartDate())
            .append("endDate", getEndDate())
            .append("masterUser", getMasterUser())
            .append("listSort", getListSort())
            .append("isEnroll", getIsEnroll())
            .append("status", getStatus())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
